<div class="con_text" style="margin-bottom:1px">
欢迎您！尊敬的<?= $name ?>卓越理财会员：
</div>
<table cellspacing="1" cellpadding="3" border="0" width="50%" style="margin-bottom: 30px;font-size:12px; font-family:Tahoma, Arial, Helvetica, sans-serif;">
    <tbody>
        <tr align="center" style="background-color: #a0a0a0;">
            <td><b>账户号码</b></td>
			<td><b>姓名</b></td>
            <td><b>余额</b></td>
            <td><b>净值</b></td>
			<td><b>平仓盈亏</b></td>
			<td><b>占用保证金</b></td>
        </tr>
<?php
   include 'public/class_dbmysql.php';
   $db = new dbmysql();
		$db->connect('107.6.113.189', 'report', 'report2013$$$', 'mt4', 'utf8', 1);
		$sql = 'SELECT u.login"交易账户",u.name"姓名",u.balance"余额",ROUND(u.equity,2)"净值",ROUND(SUM(d.PROFIT),2)"平仓盈亏",u.margin"占用保证金"
				FROM mt4_users AS u 
				LEFT JOIN mt4_daily AS d
				ON u.login=d.login AND DATE(d.time) >= "2013-02-27" AND DATE(d.time) <= ADDDATE("2013-02-27", INTERVAL 31 DAY)
				WHERE u.group IN ("demoGFX-Demo","demoGFX-test") 
				GROUP BY u.LOGIN';
        $rs = $db->query($sql);
		
			while ($rsList = $db->fetch_assoc($rs)) {
				echo '<tr align="center" bgcolor="#cccccc">
		              <td style="font-size:15px">' . $rsList["交易账户"] .'</td>
				      <td style="font-size:15px">' . $rsList["姓名"] .'</td>
		              <td style="font-size:15px">' . $rsList["余额"] .'</td>
		              <td style="font-size:15px">' .$rsList["净值"] .'</td>
                      <td style="font-size:15px">' .$rsList["平仓盈亏"] .'</td>
					  <td style="font-size:15px">' .$rsList["占用保证金"] .'</td>
					  </tr>';
			}
			
		
		$db->close();
?>
    </tbody>
</table>





